﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using PowerBooking.RSE.Utility.Helpers;
using System.Collections.Concurrent;
using System.Data.Entity;
using PowerBooking.RSE.Repository;
using PowerBooking.RSE.Poco;

namespace PowerBooking.RSE.Domain.Models
{
    /// <summary>
    /// 餐厅抽象实体
    /// </summary>
    public abstract class Restaurant
    {
        /// <summary>
        /// 餐厅ID
        /// </summary>
        public int RestaurantID { get { return restaurantPoco.RestaurantID; } }

        /// <summary>
        /// 店名
        /// </summary>
        public string Name { get { return restaurantPoco.Name; } }

        /// <summary>
        /// Url
        /// </summary>
        public string Url { get { return restaurantPoco.Url; } }

        /// <summary>
        /// 菜系标签
        /// </summary>
        public List<string> CuisineTags { get { return restaurantPoco.CuisineTags.Split(',').ToList(); } }

        /// <summary>
        /// 地区标签
        /// </summary>
        public List<string> RegionTags { get { return restaurantPoco.RegionTags.Split(',').ToList(); } }

        /// <summary>
        /// 人均
        /// </summary>
        public int[] PerCapita { get { return new int[] { restaurantPoco.MinPerCapita, restaurantPoco.MaxPerCapita }; } }

        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get { return restaurantPoco.Address; } }

        /// <summary>
        /// 口味
        /// </summary>
        public double Taste { get { return restaurantPoco.Taste; } }

        /// <summary>
        /// 环境
        /// </summary>
        public double Environment { get { return restaurantPoco.Environment; } }

        /// <summary>
        /// 服务
        /// </summary>
        public double Service { get { return restaurantPoco.Service; } }

        /// <summary>
        /// 近期订单
        /// </summary>
        public int RecentOrders { get { return restaurantPoco.RecentOrders; } }

        /// <summary>
        /// 点评
        /// </summary>
        public int Reviews { get { return restaurantPoco.Reviews; } }

        /// <summary>
        /// 餐厅Html
        /// </summary>
        protected RestaurantPoco restaurantPoco;

        /// <summary>
        /// 初始化领域对象
        /// </summary>
        /// <returns></returns>
        internal Restaurant InitDomain(RestaurantPoco restaurantPoco)
        {
            this.restaurantPoco = restaurantPoco;
            return this;
        }
    }
}
